home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.win32
- Path: netcom.com!alan
- From: alan@netcom.com (Robert Alan Wright)
- Subject: Re: VC++ 4.0 memory allocation slower than in 2.x!!!
- Message-ID: <alanDp1uEB.JHs@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- References: <alanDozpsy.Kn6@netcom.com> <4jgde4$kgo_001@chem.uva.nl> <315C86C3.57BE@sdt.com>
- Date: Fri, 29 Mar 1996 21:58:59 GMT
- Sender: alan@netcom14.netcom.com
-
- In article <315C86C3.57BE@sdt.com>, Larry Baker <leb@sdt.com> wrote:
- >
- >Note that this has nothing to do with the actual performance of
- >malloc and free themselves; this has to do with the performance of
- >the routines that use the memory allocated *by* malloc.
- >
-
- I received mail from a couple of people who actualy knew what the
- performance problem was. It turns out that the 4.0 C runtime maps
- malloc and realloc calls fairly directly to GlobalAlloc, thus
- slowing them down considerably. Apparently Microsoft thinks that
- everyone now has infinitely fast Pentiums and don't care about
- performance. Unfortunately, my customers do care a lot about the
- speed of the application in question.
-
- In any case, the old libc code which does fewer GlobalAllocs and then
- suballocates is still in the libc source. I just had to rebuild libc
- with the WINHEAP=NO option to get the old behavior back. I also had
- to fix a compilation error for malloc.c (missing include), I guess
- Microsoft didn't bother to check that this still worked :-(.
-
- The net result is that the app is now actually faster than before,
- no thanks to Microsoft (although I guess they did improve the code
- generator).
-
- Alan
-
-